//
//  ZJOSSynopsisViewController.m
//  ShangHaiHuDongApp
//
//  Created by ZJ on 2017/7/20.
//  Copyright © 2017年 刘应平. All rights reserved.
//

#import "ZJOSSynopsisViewController.h"
#import "ZJCommunitySchoolModel.h"
@interface ZJOSSynopsisViewController ()
/** scrollView */
@property (nonatomic, strong) UIScrollView *scrollView;
/** 内容 */
@property (nonatomic, strong) UILabel *contentLabel;
@end

@implementation ZJOSSynopsisViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    self.view.height = self.view.height - LP_TopHeight - 44 - 268 * [UIScreen zj_screenHScale];
    [self.view addSubview:self.scrollView];
    
    [self.scrollView addSubview:self.contentLabel];
    ZJCommunitySchoolModel *model = [ZJCommunitySchoolModel yy_modelWithJSON:self.dataDic];
    [self setContentlabelText:[NSString string:model.ABOUT isNilStringReturnDeftString:@"暂无简介"]];
}


- (void)setContentlabelText:(NSString *)text{
    self.contentLabel.text = text;
    self.contentLabel.height = [self.contentLabel getLableSizeWithMaxWidth:self.contentLabel.width].height;
    self.scrollView.contentSize = CGSizeMake(self.view.width, self.contentLabel.bottom + 14 * [UIScreen zj_screenHScale]);
    
}


#pragma mark - Getters
- (UIScrollView *)scrollView{
    if (_scrollView == nil){
        _scrollView = [[UIScrollView alloc] initWithFrame:CGRectMake(0, 0, self.view.width, self.view.height)];
        _scrollView.contentSize = _scrollView.size;
    }
    return _scrollView;
}

- (UILabel *)contentLabel{
    if (_contentLabel == nil){
        _contentLabel = [[UILabel alloc] initWithFrame:CGRectMake(12 * [UIScreen zj_screenWScale], 16 * [UIScreen zj_screenHScale], self.view.width - 24 * [UIScreen zj_screenWScale], 10)];
        _contentLabel.textColor = [UIColor textGrayColor];
        _contentLabel.font = [UIFont titleTextFont];
        _contentLabel.lineSpace = 14 * [UIScreen zj_screenHScale];
        _contentLabel.characterSpace = 1;
        _contentLabel.numberOfLines = 0;
    }
    return _contentLabel;
}

@end
